home *** CD-ROM | disk | FTP | other *** search
/ Amiga Mag HDD Backup / Amiga Mag HDD Backup.zip / Amiga Mag HDD Backup / Alexander.img.bin / Alexander.img / 315 2 files Archive.sit / Any plain-text files / ? Any plain-text file 97 < prev    next >
Text File  |  1995-01-03  |  12KB  |  2 lines

  1.  of the seven sets of five consecutive days you areforecasting. There is a file selector in the upper right cornerfor selecting AnimBrush files. There are 15 textfields at thebottom of the screen for entering the five high temperatures, thefive low temperatures, and the five AnimBrushes to use for theforecast.    The five objects to the right of the AnimBrush textfieldsare grouped, mutual exclusive, toggle select push buttons. Whenone button is pressed, it will be highlighted while the one thatis currently selected will have its highlighting removed. When afile is selected from the file selector, its name will beinserted into the AnimBrush textfield to the left of thecurrently highlighted "<-Select" button. These toggled, mutuallyexclusive buttons are actually five individual buttons that havebeen grouped by selecting all of them simultaneously and thenselecting the Object/Group menu item. The Exclude Group andToggle Select items in the Highlight Button Information requesterare checked for each button (Figure 5).    The remaining objects on the page are locked textfields.They include the title at the top of the page, the "Day 1"through "Day 5" labels to the left of the high temperaturetextfields, and the "High", "Low", and "AnimBrush" labels abovethe lower group of textfields. It is important that thesetextfields be locked because after entering text in a textfield,HELM automatically places the cursor in the next availabletextfield. Since these labels do not need to be edited, thecursor should never jump to them. HELM bypasses locked textfieldswhen repositioning the cursor. The labels above the radio buttonsselector and the file selector are the names of the selectors. Anobject name can be displayed by turning on the Caption option forthe object (Figure 6).    With the interface built, it is time to add functionality tothe book. The tasks to be accomplished by this book are toocomplicated for Actions to perform. Therefore, Scripts areneeded. These will be discussed next.The PageOpen Script for Page Two    Most of the program action occurs on page two, which is theforecast information screen. When this page first opens, itsPageOpen script executes (Listing 1). This script can be editedby going to page two and selecting the Author/Page menu item.Select the Script button when the requester appears. ThePageOpen script does only one thing: it issues a Click Oncommand. This command simulates the user clicking on an objecton the page. In this case, button id 36 is clicked. This is thetop "<-Select" button to the right of the day one AnimBrushfilename textfield. This action initializes the group oftoggled, mutually exclusive buttons. I used the ID of the buttonrather than its name because the name for all five of thesebuttons is the same: "<-Select". They had to be named the samebecause the name is what appears on the button, and the text onall five buttons needed to be the same.The SelectDown Script for the <-Select Buttons    The SelectDown script for button id 36 is shown in Listing2. It assigns a string value of Day1AnimBrush to the globalcontainer DayField. Day1AnimBrush is the name of the textfieldcontaining the AnimBrush name for day one of the forecast. Thereare similar scripts for each of the other "<-Select" buttons,assigning DayField a value of Day2AnimBrush, Day3AnimBrush, andso on. Be sure to use a SelectDown script for these buttonsrather than a SelectUp because the toggling occurs on aSelectDown. If a SelectUp script is used, it is possible for theuser to click on one of the buttons and move off of it beforereleasing the mouse button. In this case, the highlighted buttonwill be mismatched with the AnimBrush textfield name in DayField.The SelectUp Script for the File Selector    The SelectUp script for the file selector, named "Select anAnimBrush", is shown in Listing 3. It simply extracts thefilename portion of the path and filename combination returned bythe file selector and puts it in the textfield referenced by theglobal container DayField. Notice that the file selector isreferenced by the name "me". This name can be used by any scriptto refer to the object to which the script is attached.The PageClose Script for Page Two    Once all the information has been entered on page two, theGo/Next Page menu item can be selected to go to the forecastscreen. At this point, the PageClose script for page two willexecute (Listing 1). This script is the heart of the book. Itextracts the path from the file selector and puts it in a globalcontainer named BrushDir. It then extracts the names of the fiveAnimBrushes to be used by the forecast screen and puts them intofive appropriately named global containers. The six globalstring containers assigned here are used by the PageOpen scriptof page one.    Next, a string array named NameOfDays is created containingthe seven three-letter abbreviations for the days of the week.This will be used in the upcoming loop.    Before the loop, the CurDay container is initialized withthe value of the radio buttons selector, named "The Five Days",plus one. The radio button selector, having seven items, returnsa value ranging from 0 to 6, depending on the currently selecteditem. This number will determine which day is the first in theforecast. However, since the day abbreviation items in theNameOfDays array are numbered 1 through 7, a one must be added tothe value returned by the radio buttons selector.    Now a loop executes, with the value of i starting at 1 andending at 5. The string containers FirstName and SecondName arefilled with the names of the appropriate high and low temperaturetextfields, the first of which are named Day1High and Day1Low.String concatenation is used to build these names. The number incontainer i (e.g. 1) is automatically converted to a string (e.g."1") when performing the concatenation. Next, the strings in thetextfields represented by the FirstName and SecondName containersare inserted into textfields by the same name on page one. Theselatter textfields reside on the colored rectangles at the bottomof the forecast screen.    Next, the appropriate three-letter day name abbreviation isextracted from NameOfDays and put into the appropriate textfieldon page one. The textfields DayName1 through DayName5 arecentered above the five rectangles containing the AnimBrushes onthe forecast screen. Make sure the parentheses are around theexpression "DayName"&i because the textfield operator hasprecedence over the & operator. Without the parentheses, HELMwill try to concatenate i to the value of the textfield DayName.Since this textfield does not exist, an error will occur duringexecution.    Finally, the value of CurDay is updated for the next passthrough the loop. The modulo operator (%) causes the value ofthe expression CurDay%7+1 to increase to seven and then loop backto one. This will prevent an attempt to access an item inNameOfDays that does not exist.The PageOpen Script for Page One    The PageOpen script for page one executes when the page isactivated. It is shown in Listing 4. It simply combines thedirectory name stored earlier in the global container BrushDirwith each of the five AnimBrush names and then loads theAnimBrushes into the appropriate imagefields. The display islocked before doing this so that the AnimBrushes do not beginanimating until they are all loaded. The display is unlockedbefore the script ends. If the display is not locked first, theimagefields will begin animating and then, one by one, they willbe replaced with the new AnimBrushes.Complaint Department    The 5DayForecast book works very nicely, but I did get a fewheadaches putting it together. I am currently using version 1.56of HELM. Some of the problems I encountered are supposed to beremedied in version 1.61, the latest as of this writing. Thisversion is in the mail, but I did not receive it in time fortesting before submitting this article.    One problem I encountered was innocuous but annoying. Aftermodifying the script for page two and then executing the book,the appropriate AnimBrushes would not load into the imagefieldson page one. However, the day names and temperatures wereinserted properly. When I went back to page two and thenimmediately back to page one, all worked well. Something is notexecuting properly the first time page one is activated after apage script change. This is supposed to be corrected in v1.61.    Occasionally, the file requester returned a long integerrather than a path and filename. This is supposed to becorrected in v1.61.    At first I tried to load the AnimBrushes into theimagefields on page one from the PageClose script of page two.This does not work. Apparently, imagefields have to loaded afterthe page containing them becomes active.    If the combination of resolution, size, and frame rate ofAnimBrushes on a page exceed some critical value, all usercontrol of the program ends. HELM apparently gives precedence tothe animating of the images. When this situation occurs, allthat can be done is to re-boot.    HELM crashed a few times, but not many. Generally, theyoccurred when chip memory was low. One crash was particularlyinteresting. The animated startup screen asking me to insert theWorkbench diskette appeared. I have a hard disk and NEVER inserta Workbench disk. A three-finger salute returned things tonormal.    After printing a script from within the script editor, theclock pointer does not go away even when control is returned tothe user. To clear it, exit the script and then re-enter it.    If a locked imagefield is selected, the Image menu isghosted. After selecting the Edit/Unlock All menu item, theImage menu is still ghosted even though the imagefield is stillselected. The imagefield must be selected again after unlockingit for the Image menu to appear normally.Needful Things    I sure wish that the name and the label of an object werenot one and the same thing. Sometimes the label for differentobjects need to be the same, but their names different.    I wish there was a way to set the frame rate of anAnimBrush with a script command. This would allow the rate to beset at run time rather than at design time. I believe version1.61 has this feature added.    There needs to be more flexibility in selecting bordercolors for objects. Currently, a border can only use consecutivecolors in the palette.    One much needed feature is the ability to change the commonproperties of multiple objects simultaneously. Currently, thebest way to give objects common properties is to create oneobject, set its properties, and then duplicate it. However, thisonly works for the same type of objects, not different objects.Also, there are many times when the properties of a group ofobjects are initially set incorrectly and then need to be changedlater. This feature is supposed to be in HELM version 2.0, but Ido not know when that version will be available.Good Things    Even with the problems I have listed, HELM is still a greatproduct. There are so many features in this software, it is hardto believe that it is the work of essentially one programmer.Eagle Tree Software is very good about listening to usercomplaints and addressing them in future releases.    Hope to see you in a future issue.è╙b⌡:à 7»╪l/≈Θ¡v╣_┘76╓≈y┐ƒ]╕W~ë╟Γ▐f╖╕<gà╨`▒]gFsî┬ud]>┤ƒ╡    ╦┬Θ┤Lª╟═τ£_{╜(∞#▄Ω÷1┘/ow┐K╫z?_╣╧?─¡6└tÇK,│,ε4ΣAÉ\╝2Äc╘±Bn≤Tδ3∩[J¥C/k√Ñì;Σ╦<½S╞Ö</ΣT╪╜Oïª╚=εú ╥C╤î,╥D
  2. K≤╟ÅJ╚°░╞jd*ù└0»,pD ù┴▓î)╩Jl"é/è─)-G▓Ωç┼)╘├/)R ═3DΩ\[ñlsñ╤┼═:37┬≡∞h╓═-ä3ºπ╢≥0$≤#KÆCnéPφ⌠£▐JÑ*╤εL«é╣¡ñ+2SR3╙ÆvñN╧╒.ÖSΩD╫?ñ3ö∩:òZ╓O╩5J╠─j]bô╨ mA╦nsk+⌠=│Q┤àìH╪≡é⌡,R┤%3g⌐╔Ω⌐i¬¬àn╠Ti5fúBu½µ╨╒scUV▒─èº[v╡┼X]ù#U╡îΓM!¼